﻿using log4net;
using RealTimeCharts.LineChart;

namespace IDEAMS.model
{
    public class ValueRangeViewModel : ViewModelBase
    {
        private static ILog logger = LogManager.GetLogger(typeof(ValueRangeViewModel));
        public ValueRangeViewModel()
        {
            minValue = double.NaN;
            maxValue = double.NaN;
        }

        public ValueRangeViewModel(ValueRange value)
        {
            minValue = value.minValue;
            maxValue = value.maxValue;
        }

        public ValueRangeViewModel(ValueRangeViewModel value)
        {
            minValue = value.minValue;
            maxValue = value.maxValue;
        }

        public ValueRangeViewModel Clone()
        {
            return new ValueRangeViewModel(this);
        }

        public double Size()
        {
            return (maxValue - minValue);
        }

        private double m_minValue;
        public double minValue
        {
            get { return m_minValue; }
            set
            {
                if (value != this.m_minValue)
                {
                    this.m_minValue = value;
                    NotifyPropertyChanged();
                }
            }
        }

        private double m_maxValue;
        public double maxValue
        {
            get { return m_maxValue; }
            set
            {
                if (value != this.m_maxValue)
                {
                    this.m_maxValue = value;
                    NotifyPropertyChanged();
                }
            }
        }

    }
}
